package com.wardrobe.dao.booking_order;

import com.wardrobe.domain.booking_order.BookingOrderFromBean;
import com.wardrobe.domain.booking_order.BookingOrderShowBean;
import com.wardrobe.domain.booking_order.BookingOrderbean;
import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.mapper.master.booking_order.BookingOrderMasterMapper;
import com.wardrobe.mapper.slave.booking_order.BookingOrderSlaveMapper;
import com.wardrobe.soa.backend.booking_order.BackBookingOrderFromBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/20.
 */
@Service
public class BookingOrderDao {
    @Autowired
    private BookingOrderMasterMapper bookingOrderMasterMapper;
    @Autowired
    private BookingOrderSlaveMapper bookingOrderSlaveMapper;

    public BookingOrderShowBean selectBookingOrderById(long id){
        return bookingOrderSlaveMapper.selectBookingOrderById(id);
    }

    public BookingOrderShowBean selectBookingOrderByOrderId(long orderId){
        return bookingOrderSlaveMapper.selectBookingOrderByOrderId(orderId);
    }

    public List<BookingOrderShowBean> selectBookingOrder(long userId,int status){
        return bookingOrderSlaveMapper.selectBookingOrder(userId,status);
    }

    public int insertBookingOrder(BookingOrderbean bookingOrderbean){
        return bookingOrderMasterMapper.insertBookingOrder(bookingOrderbean);
    }

    public int updateBookingOrder(BackEndFromBean fromBean){
        return bookingOrderMasterMapper.updateBookingOrder(fromBean);
    }

    public int updateBookingOrderPayTime(long orderId){
        return bookingOrderMasterMapper.updateBookingOrderPayTime(orderId);
    }

    public List<BookingOrderShowBean> selectBookingOrderList(BackBookingOrderFromBean fromBean){
        return bookingOrderSlaveMapper.selectBookingOrderList(fromBean);
    }

    public long countBookingOrder(BackBookingOrderFromBean fromBean){
        return bookingOrderSlaveMapper.countBookingOrder(fromBean);
    }

    public int updateBookingOrderByOrderId(long orderId,int status){
        return bookingOrderMasterMapper.updateBookingOrderByOrderId(orderId,status);
    }
}
